<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
    <meta name="format-detection" content="telephone=no">
    <title></title>
    <script type="text/javascript" src="../applyandactivate/js/stats.js" charset="UTF-8"></script>
    <link rel="stylesheet" href="../applyandactivate/css/frozen.css">
    <link rel="stylesheet" href="../applyandactivate/css/style.css">
    <script src="../applyandactivate/lib/zepto.min.js"></script>
    <script src="../applyandactivate/js/frozen.js"></script>
    <script src="../js/link.js"></script>
</head>

<body ontouchstart>
    <div style="width:100%;height:100px;">
        <h4 style="width:40px;margin:40px auto;">loading...</h4>
    </div>
</body>
<script type="text/javascript">
$(function() {
//获取url中的参数
	function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if(r != null) {
            return unescape(r[2]);
        }
        return null;
    }
	var mobile = getQueryString("mobile");
    var bankAct = getQueryString("bankAct");//开户号
    var insuraceNo = getQueryString("insuraceNo");//保单号
    //sessionStorage中缓存的数据
    window.sessionStorage.setItem("bankAct",bankAct);//缓存理赔账号
    window.sessionStorage.setItem("insuraceNo",insuraceNo);//缓存保单号
	//sessionStorage中缓存的数据
    var channelCode=window.sessionStorage.getItem("channelCode")//渠道号
    var orderCode=window.sessionStorage.getItem("orderCode");//订单号
    var businessCode=window.sessionStorage.getItem("businessCode");//业务代码
    var baseAddress=window.sessionStorage.getItem("baseAddress");//基地地址
    var sex = window.sessionStorage.getItem("sex"); //性别
    var applyCase = window.sessionStorage.getItem("applyCase"); //护照类型原因
    var applyType = window.sessionStorage.getItem("applyType");
    var name = window.sessionStorage.getItem("name"); //用户名字
    var cardType = window.sessionStorage.getItem("cardType"); //身份证
    var cardNO = window.sessionStorage.getItem("cardNO"); //身份证号
    var birthday = window.sessionStorage.getItem("birthday"); //出生日期
    var dataStr={
            channelCode:channelCode,
            orderCode:orderCode,
            businessCode:businessCode,
            bassAddressId:baseAddress,
            name:name,
            cardType:cardType,
            cardNO:cardNO,
            birthday:birthday,
            sex:sex,
            applyType:applyType,
            applyCase:applyCase,
	    mobile:mobile
        }

    $.ajax({
        url: rootPath+"/v1/passport/applyAndActivate",
        type: 'post',
        dataType: 'json',
        contentType: 'application/json; charset=utf-8',
        data: JSON.stringify(dataStr),
        error: function(datas){
              
            }, //错误执行方法
        success: function(datas){
        if (datas["code"]==0) {        
	var passportOrderCode = datas["data"]["orderNum"];
                window.sessionStorage.setItem("passportOrderCode",passportOrderCode);
                window.location.href="success.html";
            }else{
                alert(datas["message"]);
            }
        }//成功执行方法
   })
})
</script>

</html>
